#include "Comm.hpp"

int main()
{
    //创建是server端的事情，clinet关联即可
    //获取shm
    int shmid = getShm(SHMSIZE);

    //关联
    char* start = attachShm(shmid);
    //sleep(5);
    //通信
    char c = 'A';
    int i = 0;
    while(i < 26)
    {
        start[i] = c + i++;
        start[i] = '\0';
        sleep(1);
    }
    //去关联
    detachShm(start);
    sleep(3);
    return 0;
}